﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class MenuTab : MonoBehaviour
{
    public Button m_WeaponB;
    public Button m_ShipsB;
    public Button m_MaterialsB;
    public Button m_WaterBoxB;

    public GameObject m_WeaponShopPanel;
    public GameObject m_MaterialShopPanel;
    public GameObject m_ShipShopPanel;
    public GameObject m_WaterBoxShopPanel;

    public AudioSource KaSound;
    public Shop m_Shop;
    void Start()
    {
        if(Commander.Instance.m_Member < 1)
        {
            m_WaterBoxB.gameObject.SetActive(false);
        }
    }

    // Update is called once per frame
    void Update()
    {
        
    }

    public void SetShopsEnabled(bool enabled)
    {
        m_WeaponShopPanel.SetActive(enabled);
        m_ShipShopPanel.SetActive(enabled);
        m_MaterialShopPanel.SetActive(enabled);
        m_WaterBoxShopPanel.SetActive(enabled);
    }
    public void OnShopTabClicked(GameObject shopPanel)
    {
        SetShopsEnabled(false);
        if (shopPanel)
            shopPanel.SetActive(true);
        if (KaSound)
            KaSound.Play();
    }
}
